package cn.iocoder.ny.module.mall.controller.admin.order.vo;

import cn.iocoder.ny.module.mall.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonRawValue;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@TableName(value = "mall_order_detail")
public class MallOrderDetailsVo extends BaseEntity implements Serializable {


    @TableId(value = "id", type = IdType.INPUT)
    private Long id;

    /**
     * 订单id
     */
    @NotNull(message = "订单id不能为空", groups = {Update.class,Del.class, Get.class})
    private Long orderId;

    /**
     * 订单总金额(单位：分)
     */
    @NotNull(message = "订单总金额不能为空", groups = {Add.class})
    private Integer totalAmount;

    /**
     * 表单
     */
    @JsonRawValue
    private String formJson;

    /**
     * 订单页图片展示地址
     */
    @NotNull(message = "订单页图片展示地址不能为空", groups = {Add.class})
    private String imageUrl;

    /**
     * 商品id
     */
    @NotNull(message = "商品id不能为空", groups = {Add.class})
    private Long productId;

    @NotBlank(message = "商品名称不能为空", groups = {Add.class})
    private  String productTitle;
    /**
     * 商品规格id
     */
    @NotNull(message = "商品规格id不能为空", groups = {Add.class})
    private Long specId;

    /**
     * 商品规格名称
     */
    @NotNull(message = "商品规格名称不能为空", groups = {Add.class})
    private String specName;

    /**
     * 购买数量
     */
    @NotNull(message = "购买数量不能为空", groups = {Add.class})
    private Integer quantity;

    /**
     * 购买时单价
     */
    @NotNull(message = "购买单价不能为空", groups = {Add.class})
    private Integer price;



    /**
     * 租户id
     */
    @NotNull(message = "租户id不能为空", groups = {Add.class,Query.class})
    private Long tenantId;

    /**
     * 用户id
     */
    private Long userId;
    /**
     * 删除标记  0：false   1：true
     */
    private Integer delFlag;

    /**
     * 订单状态
     */
    private Integer status;

    private static final long serialVersionUID = 1L;

    public interface Add {}
    public interface Update {}
    public interface Del {}
    public interface Query{}
    public interface Get{}
}

